package cn.gson.school.dao.jiaoxue;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Repository;

import cn.gson.school.entity.jiaoxue.AnswerEntity;

@Repository
public interface AnswerDao extends CrudRepository<AnswerEntity, Long> {

	List<AnswerEntity> findByStudentIdAndZuoYeId(Long stuId,Long zuoyeId);
	AnswerEntity findByStudentIdAndZuoYeIdAndTitleId(Long stuId,Long zuoyeId,Long titleId);
	
	@Query(value="from AnswerEntity where studentId=? and state='已提交' GROUP BY zuoYeId")
	public List<AnswerEntity> cxtijiao(Long studentId);
}
